package demo5;
import java.util.*;
import java.util.HashMap;


public class Test {
    public static void main(String[] args) {
        Set<User> users = DatabaseUtils.create();

       toMap(users);

    }

    private static void toMap(Set<User> users) {
        Set<User>  set1 = new HashSet<>();
        set1.add(new User(1,"熊大",User.BEIGING));
        set1.add(new User(3,"熊二",User.BEIGING));
        Set<User>  set2 = new HashSet<>();
        set2.add(new User(2,"光头强",User.SHANGHAI));
        Map<String, Set<User>> setMap = new HashMap<>();
        setMap.put(User.BEIGING,set1);
        setMap.put(User.SHANGHAI,set2);
        System.out.println(setMap.keySet());
        for(User user : setMap.get(User.BEIGING)){
            System.out.println(user.getId() + user.getName());
        }
        for(User user : setMap.get(User.SHANGHAI)){
            System.out.println(user.getId() + user.getName());
        }
    }
}
